package com.fhz.loginmvvm.room

import androidx.lifecycle.LiveData
import androidx.room.*
import com.fhz.loginmvvm.Data

/**
 * 时间:2023/3/28
 * @author Mr.Feng
 * 简述: TODO
 */
@Dao
interface DataDao {
    @Insert
    fun insertUser(user: Data)

    @Update
    fun updateUser(user: Data)

    @Delete
    fun deleteUser(user:Data)

    @Query("select * from user")
    fun queryAllUser() : LiveData<List<Data>>

    @Query("select * from user where uid = :uid")
    fun findUserById(uid:Int) :LiveData<Data>
}